package service;

import bean.EmpBean;
import dao.IEmpDao;
import dao.impl.EmpDaoImpl;

import java.util.List;

public class EmpServiceImpl implements  IEmpService{

    private IEmpDao iEmpDao = new EmpDaoImpl();
    @Override
    public List<EmpBean> showAllEmps() {

        return iEmpDao.getAllEmps();
    }

    @Override
    public EmpBean showEmpInfoDetail(int empId) {
        return iEmpDao.getEmpInfoById(empId);
    }

    @Override
    public int addEmpImnfo(EmpBean empBean) {
        return iEmpDao.insertEmp(empBean);
    }

    @Override
    public int updateEmpInfo(EmpBean empBean) {
        return iEmpDao.updateEmp(empBean);
    }

    @Override
    public int deleteEmpInfo(int empId) {
        return iEmpDao.deleteEmpById(empId);
    }
}
